﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Godot.core
{
    public partial class Variant
    {
        public struct CallError
        {
            public enum Error
            {
                CALL_OK,
                CALL_ERROR_INVALID_METHOD,
                CALL_ERROR_INVALID_ARGUMENT,
                CALL_ERROR_TOO_MANY_ARGUMENTS,
                CALL_ERROR_TOO_FEW_ARGUMENTS,
                CALL_ERROR_INSTANCE_IS_NULL,
            }

            public CallError.Error error;
            public Variant.Type expected;
            public int argument; 
        };

        public static bool has_numeric_constant(Variant.Type p_type, StringName p_value)  
        {
	        if(!Enum.IsDefined(typeof(Variant.Type), p_type) || p_type == Variant.Type.VARIANT_MAX)
                return false;

	        //_VariantCall::ConstantData& cd = _VariantCall::constant_data[p_type];
            return false; // cd.value.has(p_value);
        }

        public static int get_numeric_constant_value(Variant.Type p_type, StringName p_value) 
        {
	        if(!Enum.IsDefined(typeof(Variant.Type), p_type) || p_type == Variant.Type.VARIANT_MAX)
                return 0;

	        //_VariantCall::ConstantData& cd = _VariantCall::constant_data[p_type];


	       // Map<StringName,int>::Element *E = cd.value.find(p_value);
	        //ERR_FAIL_COND_V(!E,0);
            return 0;// E->get();
        }

        public static Variant construct(Variant.Type p_type, Variant[] p_args, ref CallError r_error)
        {
            r_error.error = Variant.CallError.Error.CALL_ERROR_INVALID_METHOD;

            if (!Enum.IsDefined(typeof(Variant.Type), p_type) && p_type.Equals(Variant.Type.VARIANT_MAX))
                return new Variant();

            return new Variant();
        }
    }
}
